#pragma once
#include "IPrimitive.h"
#include "Point.h"
#include "../Math/Matrix.h"
#include "../Texture/Texture.h"
#include "Traingle.h"

class Sphere:public IPrimitive
{
public:
	Sphere(Point& pos,float r);
	~Sphere(void);
	virtual void draw(IPixelDrawer* dr) ;
	virtual void setShowBorder(bool b);
	void mulMat(Mat4& mat);
	void setTexture(Texture* texture);
	float _R;
	int _N,_vN,_aN;
	Point pos;
	Traingle* tris;
	Texture* texture;
protected:
	void calcVertex(int vN,int aN);
};

